<?php
$this->breadcrumbs = array(
    'Users',
);

$this->menu = array(
    array('label' => 'Create User', 'url' => array('create')),
    array('label' => 'Manage User', 'url' => array('admin')),
);
?>

<div class="title"><h5>User List</h5></div>
<div class="widget">
    <div class="head">
        <h5 class="iFrames">User <?php echo $model->name; ?></h5>
    </div>
    <?php
    $this->widget('zii.widgets.grid.CGridView', array(
        'id' => 'user-grid',
        'dataProvider' => $dataProvider,
        'filter' => $model,
        'columns' => array(
            array(
                'name' => 'userId',
                'value' => 'CHtml::encode($data->userId)',
                'htmlOptions' => array('width' => '20'),
            ),
//        array(
//            'name' => 'avatarUrl',    
//            'type'=>'html',
//            'value' => 'CHtml::image( Yii::app()->request->baseUrl . "/../uploads/users/" . $data->avatarUrl,"",array("width"=>"150", "height"=>"150"))',
//            'htmlOptions' => array('width'=>'150'),
//        ),
            array(
                'name' => 'name',
                'value' => 'CHtml::encode($data->name)',
                'htmlOptions' => array('width' => '80'),
            ),
            array(
                'name' => 'email',
                'value' => 'CHtml::encode($data->email)',
                'htmlOptions' => array('width' => '80'),
            ),
            array(
                'name' => 'sex',
                'value' => 'CHtml::encode($data->getSexText())',
                'htmlOptions' => array('width' => '10'),
            ),
            array(
                'name' => 'dateOfBirth',
                'value' => 'CHtml::encode($data->dateOfBirth)',
                'htmlOptions' => array('width' => '20'),
            ),
            array(
                'header' => 'Commands',
                'class' => 'CButtonColumn',
                'template' => '{update}{view}{trash}{delete}',
                'buttons' => array
                    (
                    'update' => array
                        (
                        'update' => 'update',
                        'imageUrl' => Yii::app()->request->baseUrl . '/images/edit1.gif',
                    ),
                    'view' => array
                        (
                        'view' => 'view',
                        'imageUrl' => Yii::app()->request->baseUrl . '/images/details.png',
                    ),
                    'trash' => array(
                        'view' => 'trash',
                        'label' => 'Trash',
                        'imageUrl' => Yii::app()->request->baseUrl . '/images/recyclebin.png',
                        'url' => 'Yii::app()->createUrl("user/trash", array("userId" => $data->userId))',
                    ),
                    'delete' => array
                        (
                        'delete' => 'delete',
                        'imageUrl' => Yii::app()->request->baseUrl . '/images/delete.gif',
                    ),
                ),
            ),
        ),
    ));
    ?>
</div>